package pers.wensheng.patterns.behavioral_pattern.visitor_pattern.foundation;

import pers.wensheng.patterns.behavioral_pattern.visitor_pattern.foundation.entity.Cat;
import pers.wensheng.patterns.behavioral_pattern.visitor_pattern.foundation.entity.Dog;
import pers.wensheng.patterns.behavioral_pattern.visitor_pattern.foundation.entity.Owner;

/**
 * 访问者模式
 */
public class Client {
    public static void main(String[] args) {
        Dog dog = new Dog();
        Cat cat = new Cat();
        Home home = new Home();

        home.addAnimal(dog);
        home.addAnimal(cat);

        Owner owner = new Owner();

        home.action(owner);
    }
}
